import 'package:flutter/material.dart';

class DecoratedBoxDemo extends StatelessWidget {

  @override
  Widget build(BuildContext context) {
    return Scaffold(

      appBar: AppBar(title: Text('装饰类demo'),),

      ///有点类似 shape，可以绘制背景，边框什么的
      body: DecoratedBox(

        decoration: BoxDecoration(

            ///设置背景渐变
            gradient: LinearGradient(colors: [Colors.red, Colors.orange[700]]),
            borderRadius: BorderRadius.circular(5),
            boxShadow: [

              BoxShadow(
                color: Colors.black,
                offset: Offset(2.0, 2.0),
                blurRadius: 4.0,
              )
            ]
        ),

///       此属性决定在哪里绘制 Decoration 属性：background foreground
//        position: DecorationPosition.foreground,

        child: Padding(
          padding: EdgeInsets.symmetric(horizontal: 80.0, vertical: 18.0),
          child: Text('Login', style: TextStyle(color: Colors.white),),),),

    );
  }
}
